switch: Avoid problems with glyph availability
authorMatthias Clasen <mclasen@redhat.com>
Wed, 23 Jan 2019 17:02:27 +0000 (12:02 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 23 Jan 2019 20:47:02 +0000 (15:47 -0500)
If none of the glyphs we want are available, fall
back to using empty strings here, rather than causing
critical warnings.

gtk/gtkswitch.c

index 8ade76acdb11ceb3c09417f49a955e7941e1b49f..3c864b7ee25816c25a2dd8bf79bff1da6276b281 100644 (file)
@@ -288,12 +288,14 @@ gtk_switch_update_state_labels (GtkSwitch *sw)
   const char *on_glyphs[] = {
     "⏽", /* U+23FD POWER ON SYMBOL */
     "❙", /* U+2759 MEDIUM VERTICAL BAR */
+    ""
   };
 
   /* Glyphs for the OFF state, in descending order of preference */
   const char *off_glyphs[] = {
     "⭘", /* U+2B58 HEAVY CIRCLE */
     "○", /* U+25CB WHITE CIRCLE */
+    ""
   };
 
   GtkSwitchPrivate *priv = gtk_switch_get_instance_private (sw);